<template>
	<view>
		<u-swiper :list="list" indicator height="242px"></u-swiper>
		<view class="content">
			<view class="tabs">
				<view class="tab zxlx">
					<view class="tab-title">
						专项练习
					</view>
					<view class="tab-subtitle">
						声母练习 韵母联系 声调练习
					</view>
				</view>
				<view class="tab zhxl">
					<view class="tab-title">
						综合训练
					</view>
					<view class="tab-subtitle">
						单音节 多音节 短文朗诵 命题说话
					</view>
				</view>
			</view>
			<view class="mncp">
				<view class="tab-title">
					专项练习
				</view>
				<view class="tab-subtitle">
					声母练习 韵母联系 声调练习
				</view>
			</view>
		
			<view class="main-content">
				<view class="main-top">
					<view class="main-top-title">学习资源库</view>
					<view class="more">更多 <img src="@/static/img/more.png" alt="" /> </view>
				</view>
				<view class="list">
					<view class="item" v-for="(item,index) in dataList" :key="index">
						<img :src="item.img" alt="" class="img"/>
						<view class="title"> {{item.title}} </view>
						<view class="num"> {{item.num}}人观看 </view>
					</view>
				</view>
			</view>
		</view>
	
		<u-popup :show="showWarning" mode="center" :round="16">
			<view class="custom-popup">
				<view class="logo">
					<img src="@/static/img/home-warning.png" alt="" />
				</view>
				<view class="title">
					服务协议及隐私保护
				</view>
				<view class="subtitle">
					感谢您使用本平台,为了更好地保障您的个人权益,您在使用我们产品前,请您遵守
					<span style="color: #3D7CFD;" @click="toPath('/pages/settings/userAgreement/userAgreement')">《平台协议书》</span>
					和
					<span style="color: #3D7CFD;" @click="toPath('/pages/settings/privacyPolicy/privacyPolicy')">《隐私政策》</span>.
				</view>
				<view class="opt">
					<u-button class="opt-btn wzdl" type="primary" text="我知道了" @click="showWarning = false"></u-button>
					<u-button class="opt-btn cancel" type="primary" text="暂不使用" @click="showWarning = false"></u-button>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import { mapGetters } from "vuex";
	export default {
		data() {
			return {
				list:[
					require('@/static/img/lb.png')
				],
				dataList:[
					{
						id:1,
						img: require('@/static/img/zhxl.png'),
						title:'声母训练怎样入门',
						num:'69'
					},
					{
						id:2,
						img: require('@/static/img/zhxl.png'),
						title:'声母训练怎样入门',
						num:'69'
					},
					{
						id:3,
						img: require('@/static/img/zhxl.png'),
						title:'声母训练怎样入门',
						num:'69'
					},
					{
						id:4,
						img: require('@/static/img/zhxl.png'),
						title:'声母训练怎样入门',
						num:'69'
					}
				],
				showWarning: true
			}
		},
		computed: mapGetters(['isLogin', 'userInfo']),
		onLoad() {
			this.$i18n.locale = 'zh-Hans'
			if(this.isLogin){
				//用户登录后操作
			}else{
				//用户未登录操作
			}
		},
		methods: {
			toPath(path) {
				uni.navigateTo({
					url:path
				})
			}
		}
	}
</script>

<style scoped lang="less">
view {
	box-sizing: border-box;
	font-family: zktqkt, zktqkt;
}
.lb {
	width: 100%;
}

.content {
	padding: 32rpx;
	.mncp {
		margin-top: 32rpx;
		width: 100%;
		padding: 34rpx 0 28rpx 32rpx;
		background-image: url('../../static/img/mncp.png');
		background-size: 100% 100%;
		color: #FFF;
		.tab-title {
			font-size: 44rpx;
			line-height: 52rpx;
		}
		.tab-subtitle {
			font-size: 24rpx;
			line-height: 52rpx;
		}
	}
}
.content .tabs {
	display: flex;
	gap: 32rpx;
	justify-content: space-between;
	.tab {
		flex: 1;
		height: 240rpx;
		width: ;
		background-size: 100% 100%;
		color: #FFFFFF;
		text-align: center;
		.tab-title {
			margin-top: 24rpx;
			font-size: 44rpx;
			line-height: 52rpx;
		}
		.tab-subtitle {
			font-size: 24rpx;
			line-height: 52rpx;
		}
	}
	.zxlx {
		background-image: url('../../static/img/zxlx.png');
	}
	.zhxl {
		background-image: url('../../static/img/zhxl.png');
	}
	
}
.main-content {
	background: linear-gradient( 180deg, #DCEDFD 0%, #FFFFFF 100%);
	border-radius: 24rpx 24rpx 24rpx 24rpx;
	border: 2rpx solid #FFFFFF;
	padding: 28rpx 32rpx;
	margin-top: 32rpx;
	.main-top {
		display: flex;
		justify-content: space-between;
		align-items: center;
		.main-top-title {
			font-size: 36rpx;
			color: #263459;
			line-height: 52rpx;
		}
		.more {
			font-size: 24rpx;
			color: #263459;
			line-height: 52rpx;
			display: flex;
			align-items: center;
		}
	}
	.list {
		display: flex;
		gap: 32rpx 24rpx;
		flex-wrap: wrap;
		margin-top: 28rpx;
		.item {
			width: calc(50% - 13rpx);
			.img {
				width: 100%;
			}
			.title {
				margin-top: 18rpx;
				font-size: 32rpx;
				color: #263459;
				line-height: 1;
			}
			.num {
				margin-top: 16rpx;
				font-size: 24rpx;
				color: #666666;
				line-height: 1;
			}
		}
	}
}
.custom-popup {
	width: 628rpx;
	min-height: 400rpx;
	background-image: url('../../static/img/dialog-bg.png');
	background-size: 100%;
	background-repeat: no-repeat;
	padding: 24rpx 40rpx 48rpx 60rpx;
	.logo {
		height: 204rpx;
		display: flex;
		justify-content: center;
		img {
			width: 204rpx;
			height: 204rpx;
		}
	}
	.title {
		margin-top: 38rpx;
		text-align: center;
		font-size: 56rpx;
		color: #263459;
		line-height: 56rpx;
	}
	.subtitle {
		margin-top: 36rpx;
		font-size: 32rpx;
		color: #263459;
		overflow-wrap: break-word;
	}
	.opt {
		display: flex;
		gap: 28rpx;
		margin-top: 34rpx;
		height: 200rpx;
		flex-direction: column;
		.opt-btn {
			flex: 1;
			border-radius: 36rpx;
			font-size: 32rpx;
			border: none;
			width: 416rpx;
			height: 72rpx;
		}
		.cancel {
			background: #FFFFFF;
			color: #999999;
		}
		.wzdl {
			
			background: linear-gradient( 270deg, #1B5FF3 0%, #55B1F4 100%), #397FF8;
		}
	}
}
</style>